var e, t = require("../../../@babel/runtime/helpers/interopRequireDefault"), r = t(require("../../../@babel/runtime/regenerator")), a = require("../../../@babel/runtime/helpers/asyncToGenerator"), n = t(require("../../../utils/api")), u = getApp();

Page({
    data: {
        resourceUrl: u.globalData.resourceUrl,
        list: [],
        currentType: 1,
        currentIndex: 0,
        myCard: [ {
            type: 1
        }, {
            type: 2
        }, {
            type: 3
        } ]
    },
    onLoad: function() {
        this.getCultureCardList();
    },
    onUnload: function() {},
    switchType: function(e) {
        this.setData({
            currentType: e.currentTarget.dataset.type,
            currentIndex: 0
        });
    },
    getCultureCardList: (e = a(r.default.mark(function e() {
        var t, a, u, s;
        return r.default.wrap(function(e) {
            for (;;) switch (e.prev = e.next) {
              case 0:
                return t = wx.getStorageSync("openid"), e.prev = 1, e.next = 4, n.default.myCultureCardList({
                    openid: t
                });

              case 4:
                for (a = e.sent, u = this.data.myCard, s = 0; s < u.length; s++) u[s].num = a.result[u[s].type].get, 
                u[s].name = a.result[u[s].type].name;
                this.setData({
                    list: a.result,
                    myCard: u
                }), e.next = 13;
                break;

              case 10:
                e.prev = 10, e.t0 = e.catch(1), console.log(e.t0.msg);

              case 13:
              case "end":
                return e.stop();
            }
        }, e, this, [ [ 1, 10 ] ]);
    })), function() {
        return e.apply(this, arguments);
    })
});